ROWNUM: 

It is a auto-generated dynamic numbers. 
It is always in sequence. 
It always starts from 1.
Each row in a table will have corresponding rownum.


Q: How to display the rowNum for dept table?
Ans:
select deptno, dname, loc, rownum from dept;


Q: How to delete the 1 row out of 2 similar rows in the table?
Ans:
select * from student;
1001	RAJU	RAICHUR	21
1001	RAJU	RAICHUR	21

delete from student where rownum=1;


Q: How to display the first half of the table records from EMP table?
Ans:
select * from emp where rownum <= (select count(*)/2 from emp);



Q: Tell the output of the below query?
Ans:
1. select * from emp where rownum=1; --> First row of the EMP table
2. select * from emp where rownum=2; --> No record. Bcoz rownum must start with one
3. select * from emp where rownum in (1, 2, 3, 4, 5, 6)--> First 6 records from EMP table
4. select * from emp where rownum in (1, 2, 4, 5, 6) --> First 2 records from EMP table
5. select * from emp where rownum between 1 and 5 --> First 5 records from EMP table
6. select * from emp where rownum between 2 and 5 --> No record. Bcoz rownum must start with one.


Q: Display first 3 records from emp table?
Ans:
select * from emp where rownum <= 3;


Q: There are dept table with 4 records. Display rownum as 11, 12 ,13 & 14?
Ans:
select deptno, dname, loc, rownum + 10 from dept;
